import React from 'react';
import {
  View,
  Text,
  Image,
  TouchableOpacity,
} from 'react-native';

import Config from '../../config';
import SizeUtils from '../../common/SizeUtils';
import PostConstants from '../../common/PostConstants';
import Constants from '../../common/Constants';
import ZHP_Constants from './ZHP_Constants';
import ZHP_RequestContentAction from '../../actions/zahuopu/ZHP_RequestContentAction';
import ZHP_RequestCommentListAction from '../../actions/zahuopu/ZHP_RequestCommentListAction';
import PostContentPage from '../post/PostContentPage';

export default class ZHP_ContentPage extends PostContentPage {
  constructor(props) {
    super(props);
  }

  _initShowTag() {
    super._initShowTag();
    this._showCommentAfterContent = true;
    this._showTag = true;
    this._showImages = true;
  }

  _getCommentTitle() {
    return "回答区:";
  }

  _getTabText() {
    return ZHP_Constants.getTypeDataBySubTag(this.state.postData.sub_tag);
  }

  _onPressCommentButton() {
    this._goComment = true;
    this.gotoPage(Config.pages.common_comment, {data:this.state.postData, board_id:PostConstants.BOARD_ID.ZAHUOPU, moduleType:Constants.MODULE_TYPE.WORK_HARD,});
  }

  _sendRequestDataAction() {
    new ZHP_RequestContentAction().call(this, {post_id:this.props.pageData.routeData.post_id});
  }

  _getModuleType() {
    return Constants.MODULE_TYPE.ZAHUOPU;
  }

  _sendRequestCommentListAction(page = 1) {
    let data = {page:page, page_size:10, post_id:this.props.pageData.routeData.post_id};
    new ZHP_RequestCommentListAction().call(this, data);
  }
}
